<template>
  <div id="app">
    <router-view />
    <Toast />
  </div>
</template>

<script>
import { onMounted } from 'vue'
import { useStore } from 'vuex'
import Toast from './components/Toast.vue'

export default {
  name: 'App',
  components: {
    Toast,
  },
  setup() {
    const store = useStore()

    onMounted(async () => {
      // 页面加载时初始化用户数据
      await store.dispatch('initUserData')
    })
  },
}
</script>

<style>
@import './assets/tailwind.css';

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
    'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100vh;
  margin: 0;
  padding: 0;
}
</style>
